﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Galgame_decompression
{
    public partial class Settings : Form
    {
        public Settings()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog Select_text = File_slect();
            if (Select_text.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                new Cat_helper().Text_repeat(Select_text.FileName);
            }

        }

        private static OpenFileDialog File_slect()
        {
            OpenFileDialog Select_text = new OpenFileDialog();
            Select_text.Filter = "字典文件|*.txt;*.dat;*.lst";
            return Select_text;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            new Cat_helper().Folder_open(Cat_helper.local_path_temp);
        }

        private void button3_Click(object sender, EventArgs e)
        {
           
            OpenFileDialog Select_text = File_slect();
            if (Select_text.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Console.WriteLine(Select_text.FileName);
                List<string> Text_reader = new Cat_helper().Get_text_value(System.IO.Path.GetDirectoryName(Select_text.FileName)+"\\", Select_text.SafeFileName, Encoding.UTF8);
                System.IO.File.AppendAllLines(Cat_helper.local_path_temp + "PassList.dat", Text_reader);
                new Cat_helper().Text_repeat(Cat_helper.local_path_temp + "PassList.dat");

            }
        }
    }
}
